{/* Copyright 2025 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License. */}

import {Layout} from '../../../../src/Layout';
export default Layout;

import docs from 'docs:@internationalized/date';

export const section = 'Date and Time';
export const group = 'Internationalized';
export const description = 'Provides locale-aware date formatting with browser bug fixes.';

# DateFormatter

<PageDescription>{docs.exports.DateFormatter.description}</PageDescription>

## Introduction

`DateFormatter` is a wrapper around the native [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) API. It exposes the same API, but works around several browser bugs and provides polyfills for newer features. These are currently:

* A simple polyfill for the `formatRange` and `formatRangeToParts` methods for older browsers.
* A workaround for a bug involving the `hour12` option in [Chrome](https://bugs.chromium.org/p/chromium/issues/detail?id=1045791) and and the [ECMAScript spec](https://github.com/tc39/ecma402/issues/402).
* A workaround for a bug involving the `hourCycle` option in [Safari](https://bugs.webkit.org/show_bug.cgi?id=229313).

See the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) for full details on how to use the API.

## Interface

<ClassAPI links={docs.links} class={docs.exports.DateFormatter} />